package com.kanshu.ksgb.fastread.doudou.module.message.utils;

import android.util.Log;

import com.kanshu.ksgb.fastread.doudou.common.net.retrofit.RetrofitHelper;
import com.kanshu.ksgb.fastread.doudou.module.message.retrofit.MessageApi;

import java.util.HashMap;
import java.util.Map;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * 作者    wcy
 * 时间    2018/12/4 17:03
 * 文件    doudou
 * 描述
 */
public class MessageUtils {
    /**
     * 统计通知栏
     * @param message_id
     * @param position
     */
    public static void countMessageClick(String message_id, int position) {
        RetrofitHelper helper = RetrofitHelper.getInstance();
        Map<String, String> map = new HashMap<>();
        map.put("position", position + "");
        map.put("message_id", message_id);
        helper.createService(MessageApi.class)
                .countMessage(map).enqueue(new Callback<ResponseBody>() {
            @Override
            public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
                if (response != null) {
                    Log.d("wcy", response.toString());
                }
            }
            @Override
            public void onFailure(Call<ResponseBody> call, Throwable t) {}
        });

    }
}
